Skip to content

codebase conventions - #130

Open
corresp0nd wants to merge 2 commits into
mainfrom
codebaseconventions
Open

codebase conventions#130
corresp0nd wants to merge 2 commits into
mainfrom
codebaseconventions

Conversation

@corresp0nd

Copy link
Copy Markdown
Collaborator

list of what we expect from prs / code in general & explanations why

@Komonighub Komonighub left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@sleepyyapril sleepyyapril left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

meow


### Use `partial` classes to namespace clean C# edits

If you are adding a new method to an already existing upstream system (either from WizDen or Macrocosm), you may be asked to move it to a partial system under our namespace. This means you would create a new file in our file structure, and then change the namespace declaration to match the original system. This allows you to cleanly extended the system and its using directives without having to copy paste everything over.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
If you are adding a new method to an already existing upstream system (either from WizDen or Macrocosm), you may be asked to move it to a partial system under our namespace. This means you would create a new file in our file structure, and then change the namespace declaration to match the original system. This allows you to cleanly extended the system and its using directives without having to copy paste everything over.
If you are adding a new method to an already existing upstream class (either from WizDen or Macrocosm), you may be asked to move it to a partial class under our namespace. This means you would create a new file in our file structure, and then change the namespace declaration to match the original system. This allows you to cleanly extend the class and its using directives without having to copy paste everything over.


## Use the `Fu` prefix to replace entities or locale

There are times when entities change so drastically from their upstream version that it is easier to create new entities entirely. When we do this, we add the `Fu` prefix to the new entity id and create it in our namespace. You would then replace all of the usages of the old entity with the new id.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hehe. no review. just funny. Fu. Hehe.


There are times when entities change so drastically from their upstream version that it is easier to create new entities entirely. When we do this, we add the `Fu` prefix to the new entity id and create it in our namespace. You would then replace all of the usages of the old entity with the new id.

To "remove" the old entity, you can then make it abstract by adding `abstract: true` to the entity, or bulk abstract the entire file by adding it to `ignoredPrototypes.yml`. You can also add a line in `migration.yml` to migrate the old entity to the new one, for example adding the line `ClothingOuterWinterHos: FuClothingOuterWinterHos`.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in my experience migrations bad but specifically for replacing content its good


## Content should be properly commented

All code should have comments explaining *what* and *why* it is doing. Do not assume that code is self-documenting. Readable variable and class names is always good practice, but even with that, not all code is self-documenting. This also lessens the burden on your fellow contributors and maintainers; none of us are omnipresent and can immediately understand what you intended to do. Commenting your code, and even including some of your thought process, can help everyone better build and improve the codebase.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

its already difficult to get people to comment methods, you should probably only enforce that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants